@extends('home.layout.index')
@section('content')
<div id="container">
    <div class="content">
        <div class="aside">
            <!-- 精彩回答 -->
            <div class="aside-section">
                <div class="aside-ask">
                    <h3 class="aside-ask-tit">提问的正确姿势</h3>
                    <ol class="aside-ask-lst">
                        <li><span>①</span> 问题要具体、语句通顺，不寻求模糊空洞的答案。广告等违反社区规则的提问将被删除并给予处罚。</li>
                        <li><span>②</span> 句式、标点符号使用严谨，问题尽量不含有与问题本身无关的词语（如：跪求大神，急急急）。</li>
                        <li><span>③</span> 打上正确的标签、添加悬赏将有助于更快地获得满意回答。</li>
                    </ol>
                </div>
            </div>
            <!-- //精彩回答 -->
        </div>
        <form action="/home/question" method="post" enctype="multipart/form-data">
        {{csrf_field()}}
        <div class="main">
            <div class="ask-wrap">
                                                    <h1 class="ask-tit">描述您的问题</h1>
                                <div class="popup-tit">问题描述<span class="popup-tit-required">（必填）<i>*</i></span></div>
                <!-- 默认态：ipt-default;
                     输入状态：ipt-cur;
                     输入有误状态：ipt-err;-->
                <!-- 标题-激活 -->
                <div class="ipt-box ipt-cur">
                    <input type="text" name="q_title" id="ask_title" placeholder="一句话描述您的问题" class="popup-txtarea textarea" data-maxlength="40">
                    <input type="hidden" name="q_time" value="{{date('Y-m-d H:i:s',time())}}">
                    <input type="hidden" name="status" value="0">
                    <input type="hidden" name="uid" value="{{session('login')}}">
                    <input type="hidden" name="username1" value="{{session('username')}}">

                    <!-- 答案列表 -->
                    <div class="ipt-lst-question same_question_box hide">
                        <div class="ipt-tit-question"><a href="/h/sougou/javascript:;" class="btn-ipt-tit-question close_same_question">关闭</a>您的问题可能已经有了答案：</div>
                        <ul class="popup-lst-question same_question_list"></ul>
                    </div>
                    <!-- //答案列表 -->
                </div>
                <!-- //标题-激活 -->
                <div class="desc_ask">
                    <div class="ipt-bar"><span class="ipt-bar-txt">问题补充说明：</span></div>
                    <div class="ipt-box">
                        <!-- <textarea id="ask_content" name="q_content" cols="30" rows="3" placeholder="在这里继续补充您的问题细节" class="popup-txtarea popup-txtarea-h4 textarea" data-maxlength="200"></textarea>
                        <div class="ipt-limit wordsLimit">可以输入<em>200</em>个字</div> -->
                        <script type="text/javascript" charset="utf-8" src="{{asset('ueditor/ueditor.config.js')}}"></script>
                            <script type="text/javascript" charset="utf-8" src="{{asset('ueditor/ueditor.all.min.js')}}"> </script>
                            <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
                            <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
                            <script type="text/javascript" charset="utf-8" src="{{asset('ueditor/lang/zh-cn/zh-cn.js')}}"></script>
                            <script id="editor" type="text/plain" name="art_content" style="width:600px;height:320px;"></script>
                            <script>
                                var ue = UE.getEditor('editor');
                            </script>
                            <style>
                                .edui-default{line-height: 28px;}
                                div.edui-combox-body,div.edui-button-body,div.edui-splitbutton-body
                                {overflow: hidden; height:20px;}
                                div.edui-box{overflow: hidden; height:22px;}
                            </style>

                    </div>
                </div>

                <!--问题标签添加-->
                <h4 style="color:green;">问题标签添加</h4><br>

                一级分类：<select name="cate_id" id="q_c1" style="width:140px;">
                <option value="">请选择</option>
                    @foreach($weq as $k=>$v)
                    <option value="{{$v['id']}}">{{$v['cate_name']}}</option>
                    @endforeach
                </select>
                二级分类：<select name="cate_pid" id="q_c2" style="width:140px;">
                <!-- <option value="">请选择</option> -->


                    <!-- <option value="" id="q_c3"></option> -->

                </select><br><br><br>
                <h4>请添加标签</h4><br>
                <select name="tag_name" id="tag_name" style="border:1px solid #ccc;height:22px;width:220px;">
                    
                </select>
                <!-- <input type="text" name="tag_name" style="border:1px solid #ccc;height:22px;width:220px;" id="s_id" class="popup-txtarea textarea"> -->
                <span id="span1"></span>

                <!-- <input type="text" name="tag_name" style="border:1px solid #ccc;height:22px;width:220px;" class="popup-txtarea textarea"> -->
                <!-- <select name="tag_name" id="q_c3" style="width:140px;"> -->
                <!--问题标签添加结束-->
                <script src="/a/js/jquery-1.9.1.min.js"></script>
                <script>
                    var q_c1=document.getElementById('q_c1');
                    var q_c2=document.getElementById('q_c2');

                    var tag_name = document.getElementById('tag_name');
                    var span1 = document.getElementById('span1');


                    q_c1.onchange=function()
                    {
                        var str=q_c1.value;


                        q_c2.options.length = 0;


                        $.get('/home/question/create',{'id':str},function(msg)
                        {

                            var arr = JSON.parse(msg) ;

                            $.each( arr, function(i,n)
                            {

                               $('#q_c2').append("<option value='"+n.id+"'>"+n.cate_name+"</option>");
                            });

                        });

                    }

                    tag_name.onfocus=function(){


                        var tag=document.getElementById('q_c2');
                        var tag_id=tag.value;
                        if(!tag_id){
                            span1.innerHTML="<font style='font-size:10px;'>请选择分类</font>";

                        }else{
                            tag_name.options.length = 0;
                            $.get('/home/tag_name',{'id':tag_id},function(msg)
                            {
                                var arr = JSON.parse(msg) ;
                                $.each( arr, function(i,n)
                                {

                                   $('#tag_name').append("<option value='"+n.tag_id+"'>"+n.tag_name+"</option>");
                                   // s_id.value=n.tag_name;

                                });
                            });

                        }
                    }
                    s_id.onblur=function(){
                        span1.innerHTML="";
                    }
                </script>


                <div class="popup-tit">问题悬赏</div>
                <!-- 问题悬赏 -->
                <div class="popup-reward score_list  dim ">

                       <select name="" id="" class="btn-popup-reward select_score">
                           <option value=""></option>
                       </select>
                                            <div class="popup-reward-txt">您目前问豆为: <em class="emphasis-clr2">0</em><br>不足以支付赏金哦~</div>
                                    </div>
                <!-- //问题悬赏 -->
                <div id="validCodeWrap"></div>
                <!-- ft-bar -->
                <div class="ft-bar">
                    <div class="ft-btn-box">
                    <input type="submit" value="提交" class="btn-reply-submit">
                        <!-- <a href="/h/sougou/javascript:;" id="submit_question" class="btn-reply-submit">提&nbsp;&nbsp;&nbsp;&nbsp;交</a> -->
                    </div>
                    <div class="btn-anonymous">
                        <input type="checkbox" id="ask_anonymous">
                        <label for="ask_anonymous">匿名</label>
                    </div>
                </div>
                <!-- //ft-bar -->
            </div>
        </div>
        </form>
    </div>
</div>



<script>
    var _gtag = _gtag || {};

    _gtag = {
        static_files_prefix: '/sf',
        userId: '10',
        clbUid: '-1',
        orig: 253,
        traceId: 'e74f1f97c510bc6848e05a96b35ecdc9',
        isLogin : false,
        search_url : '/s/?w=',
        ajax: {
            smartbox: 'http://sugg.search.wenwen.sogou.com/service-search/ajax/smartbox'
        },
        captcha: true,
        helperSelf: 'false' === 'true'
    };

</script>

<script crossorigin="anonymous" src="/h/sougou/js/jquery-1.11.1.min.js"></script>
<script crossorigin="anonymous" src="/h/sougou/js/polyfill.min.js"></script>

<script crossorigin="anonymous" src="/h/sougou/js/preact.min.js">
</script><script crossorigin="anonymous" src="/h/sougou/js/main.js"></script>
<script crossorigin="anonymous" src="/h/sougou/js/main.js"></script>
<script crossorigin="anonymous" src="/h/sougou/js/main.js"></script>
<script crossorigin="anonymous" src="/h/sougou/js/main.js"></script>
<script crossorigin="anonymous" src="/h/sougou/js/main_619f331.js"></script>

<script crossorigin="anonymous" src="/h/sougou/js/main_20f616b.js"></script>
</div>
       <div id="popup_wrap" style="z-index:2;"></div>
        <div id="imagePreview_wrap"></div>
    </div>
    <script crossorigin="anonymous" src="/h/sougou/js/an_v5.js"></script>
<script crossorigin="anonymous" src="/h/sougou/js/main.js"></script></body>



@endsection